<?php /* Smarty version 2.6.2, created on 2011-05-24 00:02:22
         compiled from add_program2.tpl */ ?>
<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'add_program2.tpl', 142, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php echo '
	<script>
		function checkEmail() {
			var email = document.add_form.email;
			var filter = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;
			if(email.value.trim().length == 0){
				alert(\'Please, enter your E-Mail address!\');
				email.focus();
				email.select();
				return false;
			}else if (!filter.test(email.value)) {
				alert(\'Please provide a valid email address\');
				email.focus();
				email.select();
				return false;
			}
			return true;
		}
		function validate(){
			return true;
		  var d = document.add_form;
		  if (!d.name.value) {
		    alert(\'Please enter your Site Name.\');
		    d.name.focus();
		    return false;
		  }
		  if (!d.url.value){
		    alert(\'Please enter your Site URL.\');
		    d.url.focus();
		    return false;
		  }
		  if(!checkEmail()){
			  return false;
		  }
		 //edit by chiang
		 var tempd = d.name.value.toLowerCase();
		  if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid Site Name!\');
			 d.name.focus();
			 d.name.select();
			 return false;
		  }
		  
		 tempd = d.url.value.toLowerCase();
		 if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid Site URL!\');
			 d.url.focus();
			 d.url.select();
			 return false;
		 }
		  
		 tempd = d.percents.value.toLowerCase();  
		 if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid percents!\');
			 d.percents.focus();
			 d.percents.select();
			 return false;
		 }
		  
		 tempd = d.min_spend.value.toLowerCase(); 
		 if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid min_spend!\');
			 d.min_spend.focus();
			 d.min_spend.select();
			 return false;
		  }
		  
		  tempd = d.max_spend.value.toLowerCase(); 
		  if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid max_spend!\');
			 d.max_spend.focus();
			 d.max_spend.select();
			 return false;
		  }
		
		  tempd = d.referral.value.toLowerCase();
		  if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid referral!\');
			 d.referral.focus();
			 d.referral.select();
			 return false;
		  }
		
		  tempd = d.description.value.toLowerCase();
		  if (tempd.indexOf(\'<script\')>0 || tempd.indexOf(\'<iframe\')>0){
		  	 alert(\'Valid description!\');
			 d.description.focus();
			 d.description.select();
			 return false;
		  }
		  
		  //edit by chiang
		  return true;
		}
	</script>
'; ?>

<form method=post name="add_form" onsubmit="return validate()">
<input type="hidden" name="a" value="add">
<input type="hidden" name="action" value="add_program">
<input type="hidden" name="payment_type" value="<?php echo $this->_tpl_vars['payment_type']; ?>
">
<input type="hidden" name="group_id" value="<?php echo $this->_tpl_vars['group_id']; ?>
">
<input type="hidden" name="group_name" value="<?php echo $this->_tpl_vars['group_name']; ?>
">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td class="box1"> 	
			<img src="images/t7.gif" align="left">
			<div class="side_title" align="left">Add listing to <b><?php echo $this->_tpl_vars['group']['name']; ?>
</b> list:</div>
		</td>
	</tr>
	
	<tr>
		<td class="box2">
			<?php if ($this->_tpl_vars['errors']): ?>
				<br>
				<?php if (isset($this->_sections['e'])) unset($this->_sections['e']);
$this->_sections['e']['name'] = 'e';
$this->_sections['e']['loop'] = is_array($_loop=$this->_tpl_vars['errors']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['e']['show'] = true;
$this->_sections['e']['max'] = $this->_sections['e']['loop'];
$this->_sections['e']['step'] = 1;
$this->_sections['e']['start'] = $this->_sections['e']['step'] > 0 ? 0 : $this->_sections['e']['loop']-1;
if ($this->_sections['e']['show']) {
    $this->_sections['e']['total'] = $this->_sections['e']['loop'];
    if ($this->_sections['e']['total'] == 0)
        $this->_sections['e']['show'] = false;
} else
    $this->_sections['e']['total'] = 0;
if ($this->_sections['e']['show']):

            for ($this->_sections['e']['index'] = $this->_sections['e']['start'], $this->_sections['e']['iteration'] = 1;
                 $this->_sections['e']['iteration'] <= $this->_sections['e']['total'];
                 $this->_sections['e']['index'] += $this->_sections['e']['step'], $this->_sections['e']['iteration']++):
$this->_sections['e']['rownum'] = $this->_sections['e']['iteration'];
$this->_sections['e']['index_prev'] = $this->_sections['e']['index'] - $this->_sections['e']['step'];
$this->_sections['e']['index_next'] = $this->_sections['e']['index'] + $this->_sections['e']['step'];
$this->_sections['e']['first']      = ($this->_sections['e']['iteration'] == 1);
$this->_sections['e']['last']       = ($this->_sections['e']['iteration'] == $this->_sections['e']['total']);
?>
					&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red">- <?php echo $this->_tpl_vars['errors'][$this->_sections['e']['index']]['name']; ?>
<br></span>
				<?php endfor; endif; ?>
			<?php endif; ?>
			
			<p align="center"> <b>
					After entering and submitting the form below. Your program will automatically be added to our listing
				</b> </p>
			<table cellspacing="1" cellpadding="2" border="0" width="90%" align="center" >
				<tr align=left >
		 			<th>Listing type:</th>
		 			<td>
		 				<span><?php echo $this->_tpl_vars['group_name']; ?>
&nbsp;</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Batch No:</th>
		 			<td>
		 				<input type="text" name="batch" value="<?php echo $this->_tpl_vars['batch']; ?>
" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				
				<tr align=left>
		 			<th>Site Name:</th>
		 			<td>
		 				<input type="text" name="name" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Site URL:</th>
		 			<td>
		 				<input type="text" name="url" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['url'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Contact E-mail:</th>
		 			<td>
		 				<input type="text" name="email"   value="<?php echo $this->_tpl_vars['email']; ?>
" class=inpts_add size=50>
		 				<span class="req_feild">*</span>
		 			</td>
				</tr>
				<tr align=left>
		 			<th>Interest Percents:</th>
		 			<td><input type="text" name="percents" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['percents'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Minimal Spend:</th>
		 			<td><input type="text" name="min_spend" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['min_spend'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Maximal Spend:</th>
		 			<td><input type="text" name="max_spend" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['max_spend'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Referral Bonus:</th>
		 			<td><input type="text" name="referral" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['referral'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>Withdrawal Type:</th>
		 			<td>
					   <select name="withdrawal_type" class=inpts_add>
					     <option value=1 >Manual</option>
					     <option value=2 >Instant</option>
					     <option value=3 >Automatic</option>
					   </select> 
					</td>
				</tr>
				<tr align=left>
		 			<th>Support E-mail:</th>
		 			<td><input type="text" name="support_email" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['support_email'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>TG Support Forum:</th>
		 			<td><input type="text" name="support_form" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['support_form'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>MMG Support Forum:</th>
		 			<td><input type="text" name="support_forum" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['support_forum'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		 			<th>DTM Support Forum:</th>
		 			<td><input type="text" name="support_aim" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['support_aim'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" class=inpts_add size=50></td>
				</tr>
				<tr align=left>
		  			<th valign=top >Payment Methods:</th>
		  			<td>
						<?php if (isset($this->_sections['p'])) unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['payments']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?>
						   <input type="checkbox" name="payments[<?php echo $this->_tpl_vars['payments'][$this->_sections['p']['index']]['name']; ?>
]" value=1><?php echo $this->_tpl_vars['payments'][$this->_sections['p']['index']]['name']; ?>
 
						   <br>
						<?php endfor; endif; ?>  
					</td>
				</tr>
				<tr align=left>
		  			<th>Description</th>
		  			<td>
			  			<textarea name="description" cols=47 rows=5 class=inpts  style="-moz-border-radius: 5px 5px 5px 5px;" ><?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['description'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
</textarea>
		  			</td>
				</tr>
				<tr align=left>
		  			<td colspan=2><span class="req_feild">*</span> - Required fields</td>
				</tr>
				<tr align=left>
		  			<td colspan="2"><input class="sbmt" type="submit" value="Add My Program Now" /></td>
		  		</tr>
			</table>
		</td>
	</tr>
</table>	
</form>


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>